package com.xuelang.pipeline.domain.task.service.impl;

import com.xuelang.pipeline.domain.task.TaskInstance;
import com.xuelang.pipeline.domain.task.repository.TaskInstanceRepository;
import com.xuelang.pipeline.domain.task.service.TaskInstanceDomainService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>任务实例域服务实现类</p>
 *
 * @author : yixin.lys
 * @date : 2024-06-19 13:23
 **/
@Service
public class TaskInstanceDomainServiceImpl implements TaskInstanceDomainService {

    @Autowired
    private TaskInstanceRepository repository;

    @Override
    public List<TaskInstance> queryByPipelineInstanceCode(String pipelineInstanceCode) {
        return repository.queryByPipelineInstanceCode(pipelineInstanceCode);
    }

    @Override
    public TaskInstance queryByTaskUuid(String taskUuid, String pipelineInstanceCode) {
        return repository.queryByTaskUuid(taskUuid, pipelineInstanceCode);
    }

    @Override
    public List<String> queryBuildOutput(String pipelineInstanceCode, String taskInstanceCode) {
        return repository.queryBuildOutput(pipelineInstanceCode, taskInstanceCode);
    }

    @Override
    public TaskInstance queryByTaskCode(String code) {
        return repository.queryByTaskCode(code);
    }

    @Override
    public void add(TaskInstance taskInstance) {
        repository.add(taskInstance);
    }

    @Override
    public void update(TaskInstance taskInstance) {
        repository.update(taskInstance);
    }

    @Override
    public void removeByIds(List<String> idList) {
        repository.removeByIds(idList);
    }

    @Override
    public void removeByPipelineInstanceCodeList(List<String> pipelineInstanceCodeList) {
        repository.removeByPipelineInstanceCodeList(pipelineInstanceCodeList);
    }

    @Override
    public void removeByTaskUuidList(List<String> taskUuidList) {
        repository.removeByTaskUuidList(taskUuidList);
    }
}
